<?php
/**
 * Email:y7wanghui@gmail.com
 * File_Name:post.php
 */
require_once "database.php";

$id = $_GET["id"];

$sql = "SELECT * FROM `post` WHERE `article_id`  = $id";

$result = $conn->query($sql);


if ($result->num_rows > 0) {
    // 输出单条数据
    $res = $result->fetch_assoc();
    $text = $res['text'];
    $time = $res['time'];
    $name = $res["name"];
    $res  = ['text'=>$text,'time'=>$time,'name'=> $name];


} else {
    echo "0 结果";
}

echo json_encode($res);
